Skip to content

chore: use @code-pushup/nx-plugin in repo#1091

Open
BioPhoton wants to merge 86 commits intomainfrom
use-cp-nx-plugin
Open

chore: use @code-pushup/nx-plugin in repo#1091
BioPhoton wants to merge 86 commits intomainfrom
use-cp-nx-plugin

Conversation

@BioPhoton
Copy link
Collaborator

@BioPhoton BioPhoton commented Aug 27, 2025

Precondition:

This PR includes:

  •  use plugin for main and cached targets
  • use executor on all targets
  • remove existing target configurations in projects
  • add docs
  • add validation helper script

Related:
closes #971

TODO Run local code

tsx is a utility to run TypeScript files in node which is growing in popularity:
https://tsx.is

Behind the scenes it is invoking node with relevant --require and --import flags.

If the user is invoking Nx via a script which is being invoked via tsx, then we
do not need to register any transpiler at all as the environment will have already
been configured by tsx. In fact, registering a transpiler such as ts-node or swc
in this case causes issues.

Because node is being invoked by tsx, the tsx binary does not end up in the final
process.argv and so we need to check a few possible things to account for usage
via different package managers (e.g. pnpm does not set process._ to tsx, but rather
pnpm itself, modern yarn does not set process._ at all etc.).

Changes where tested by:

  1. npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1091
  2. add plugin inc options to nx.json
{
  "pluginsConfig": {
    "@code-pushup/nx-plugin": {
      "projectPrefix": "cli",
      "bin": "packages/cli/src/index.ts",
      "env": {
        "NODE_OPTIONS": "--import tsx",
        "TSX_TSCONFIG_PATH": "tsconfig.base.json"
      }
    }
  },
  "plugins": [
    {
      "plugin": "@code-pushup/nx-plugin",
      "options": {
        "targetName": "cp"
      }
    }
  ]
}

@nx-cloud
Copy link

nx-cloud bot commented Aug 28, 2025

View your CI Pipeline Execution ↗ for commit 7a8fb79

Command Status Duration Result
nx run ci:code-pushup -- merge-diffs --files=/h... ❌ Failed 1s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 2m 46s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 21m 36s View ↗
nx run-many -t unit-test,int-test ✅ Succeeded 39s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-09 00:43:41 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 28, 2025

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1091

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1091

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1091

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1091

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1091

@code-pushup/axe-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/axe-plugin@1091

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1091

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1091

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1091

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1091

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1091

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1091

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1091

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1091

commit: 0b4ecf4

@github-actions github-actions bot added the 📖 Project documentation improvements or additions to the project documentation label Sep 4, 2025
# Conflicts:
#	packages/nx-plugin/src/executors/cli/schema.json
#	packages/nx-plugin/src/executors/cli/schema.ts
@BioPhoton BioPhoton marked this pull request as ready for review September 4, 2025 14:23
BioPhoton added a commit that referenced this pull request Dec 2, 2025
related to #1091 

**This PR includes:**
- alignments of terminal args helper
- add command formatter helper to `utils`
- reuse utils in `nx-plugin` and remove old code
- remove bin logic from config target (left over of #1109)

---------

Co-authored-by: John Doe <john.doe@example.com>
Michael Hladky added 2 commits December 4, 2025 21:11
# Conflicts:
#	e2e/nx-plugin-e2e/tests/plugin-create-nodes.e2e.test.ts
#	packages/nx-plugin/src/executors/cli/executor.int.test.ts
#	packages/nx-plugin/src/executors/cli/executor.unit.test.ts
#	packages/utils/src/index.ts
#	packages/utils/src/lib/logger.ts
#	packages/utils/src/lib/transform.unit.test.ts
@github-actions
Copy link
Contributor

github-actions bot commented Dec 15, 2025

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit ae96f86 with previous commit 3137af7.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🔴 40 🔴 36 ↓ −4.4
Code coverage 🟢 93 🟢 93 ↓ −0.1
Bug prevention 🟡 75 🟡 75 ↓ −0.1
Axe Accessibility 🟡 88 🟡 88 ↓ −0.1
Code style 🟢 100 🟢 100
Security 🔴 47 🔴 47
Updates 🟡 75 🟡 75
Type Safety 🟡 67 🟡 67
Miscellaneous 🟡 67 🟡 67
Documentation 🟡 53 🟡 53
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟢 92 🟢 92
👎 2 groups regressed, 👍 3 audits improved, 👎 5 audits regressed, 12 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🔴 40 🔴 36 ↓ −4.4
Code coverage Code coverage metrics 🟢 93 🟢 93 ↓ −0.1

32 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Initial server response time was short 🟥 Root document took 660 ms 🟩 Root document took 480 ms ↓ −28.2 %
Lighthouse Total Blocking Time 🟥 1,040 ms 🟥 2,130 ms ↑ +104.6 %
Lighthouse First Contentful Paint 🟥 3.3 s 🟥 3.1 s ↓ −6.4 %
Lighthouse Speed Index 🟥 6.8 s 🟥 6.4 s ↓ −6.5 %
Lighthouse Max Potential First Input Delay 🟥 620 ms 🟥 1,340 ms ↑ +114.4 %
Lighthouse Time to Interactive 🟥 13.1 s 🟥 13.7 s ↑ +4.2 %
Code coverage Line coverage 🟩 92.8 % 🟩 92.7 % ↓ −0.1 %
Code coverage Branch coverage 🟨 89.2 % 🟨 89.2 % ↓ −0.1 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,089 KiB 🟩 Total size was 2,098 KiB ↑ +0.4 %
Lighthouse Minimizes main-thread work 🟥 8.1 s 🟥 11.2 s ↑ +38.2 %
Lighthouse JavaScript execution time 🟥 2.1 s 🟥 3.6 s ↑ +72.2 %
Lighthouse Largest Contentful Paint 🟥 11.7 s 🟥 12.6 s ↑ +7.8 %
Lighthouse Server Backend Latencies 🟩 300 ms 🟩 1,190 ms ↑ +303.4 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +4.2 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 111 KiB 🟥 Potential savings of 111 KiB ↑ +25 %
Lighthouse Reduce unused JavaScript 🟥 Potential savings of 225 KiB 🟥 Potential savings of 225 KiB ↓ −12.5 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 65 KiB 🟥 Potential savings of 87 KiB ↑ +50 %
Lighthouse Uses efficient cache policy on static assets 🟨 31 resources found 🟨 31 resources found ↑ +0.1 %
Lighthouse Network Round Trip Times 🟩 70 ms 🟩 20 ms ↓ −73.1 %
Lighthouse Cumulative Layout Shift 🟩 0.003 🟩 0 ↓ −100 %

659 other audits are unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant